package top.anonyeast.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;

@Controller
public class HelloController {
    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "Hello,World";
    }

    @RequestMapping("/hello01")
    public String helloThymeleaf(Model model){
        model.addAttribute("msg","<h2>Hello,Thymeleaf</h2>");
        model.addAttribute("users", Arrays.asList("anonyeast","xhh"));
        return "test";
    }
}
